package com.ys.service.storage.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ys.mapper.storage.StorageMapper;
import com.ys.service.storage.TccStockControlDailyService;

@Service("tccStockControlDailyService")
public class TccStockControlDailyServiceImpl implements TccStockControlDailyService {

    private static final Logger logger = LoggerFactory.getLogger(TccStockControlDailyServiceImpl.class);

	@Autowired
	private StorageMapper diySqlMapper;

	@Override
	public void addBatch(String day) {
		if (day == null || day.length() != 10) {
			return;
		}
		
		// 删除每日数据
		diySqlMapper.deleteBatchTccStockControlDailyByDay(day);
		
		// 添加每日数据
		int i = diySqlMapper.insertBatchTccStockControlDailyByDay(day);
		logger.info("日期---" + day + "，添加数量---" + i);
	}
}
